package com.black.platform.codeType.web;

import com.black.common.web.ApiResponse;
import com.black.common.web.ApiResponseBuilder;
import com.black.platform.codeType.service.CodeTypeService;
import com.black.platform.codeType.vo.CodeTypeSearchVo;
import com.black.platform.codeType.vo.CodeTypeVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("codeType")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CodeTypeController {

    private final CodeTypeService codeTypeService;

    @PostMapping
    public ApiResponse<List<CodeTypeVo>> search(@RequestBody CodeTypeSearchVo searchVo) {
        return ApiResponseBuilder.ok(codeTypeService.search(searchVo));
    }
}
